﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace Matching 
{
    class Matching
    {
        static void Main(string[] args)
        {
            string text = "text texting na maikat ti text i tn.";
            string pattern = "text";
            Match match = Regex.Match(text, pattern);
            while (match.Success) 
            {
                Console.WriteLine("{0} at {1}",match,match.Index);
                match = match.NextMatch();
            }
        }
    }
}
